﻿CREATE TRIGGER RolesPermissions_Tracking_Delete
ON [dbo].[RolesPermissions] 
AFTER delete
AS 
BEGIN
	UPDATE Sync.RolesPermissions_Tracking 
	SET LastUpdatedDate  = getdate(),
		IsDeleted = 1
	FROM Sync.RolesPermissions_Tracking s JOIN DELETED i
    ON s.PermissionID = i.PermissionID AND s.RoleID = i.RoleID
END





